#ifndef GAME_H
#define GAME_H

#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include <QMessageBox>
namespace Ui {
class Game;
}

class Game : public QWidget
{
    Q_OBJECT

public:
    explicit Game(QWidget *parent = 0);
    const int SIZE=19;
     const int WIDTH=40;
     const int x=20,y=20;
    ~Game();
signals:
    void myexit();
protected:
    void mousePressEvent(QMouseEvent *e);		//--鼠标按下事件
    void closeEvent( QCloseEvent * event );
private:
    Ui::Game *ui;
    void paintEvent(QPaintEvent *);//绘图函数声明
    QPainter *paint;
    void handleTimeout();
    void intCoord();
    void goOn(QString colora);
    int coord[20][20];
    int abscissa,ordinate;
    bool flag;
    bool judge (int i,int abscissa,int ordinate);
    bool judgeVertical (int i,int abscissa,int ordinate);
    bool judgeLevel  (int i,int abscissa,int ordinate);
    bool judgeLeftbias  (int i,int abscissa,int ordinate);
    bool judgeRightbias  (int i,int abscissa,int ordinate);

};

#endif // GAME_H
